<%@page import="Model.Purchase.PurchaseMaterielList"%>
<%@page import="Model.My.PurchaseResultListView"%>
<%@page import="Model.Purchase.PurchaseMaterielOfferView"%>
<%@page import="Model.Purchase.PurchaseMaterielListView"%>
<%@page import="Model.Purchase.PurchaseList"%>
<%@page import="RssEasy.Core.HttpRequestHelper"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    HttpRequestHelper hrh = new HttpRequestHelper(pageContext).request();
    PurchaseList pl = new PurchaseList(pageContext);
    PurchaseMaterielList pml = new PurchaseMaterielList(pageContext);
    PurchaseMaterielOfferView pmov = new PurchaseMaterielOfferView(pageContext);
    PurchaseResultListView prlv = new PurchaseResultListView(pageContext);
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>企企通-询价比-我的项目</title>
        <meta name="description" content="这里写网站内容描述" />
        <meta name="keywords" content="这里写关键词" />
        <meta name="Robots" contect="all">
        <link href="/css/reset.css" rel="stylesheet" type="text/css" />
        <link href="css/my_project.css" rel="stylesheet" type="text/css" />
        <link href="/wdatepicker/skin/default/datepicker.css" rel="stylesheet" type="text/css"/>
    </head>
    <body marker="<%hrh.write("part");%>">
        <h1>询价比管理</h1>
        <div id="detailsBox">
            <%
                pl.select().where("id=?", hrh.get("purchaseid")).get_first_rows();
            %>
            <h2>项目名称：<%pl.write("name");%><a marker="<%hrh.write("value");%>" href="enquiry.jsp">关闭详情</a></h2>
            <table>
                <tr><td>报名截止时间：</td><td rssdate="<%pl.write("enddt");%>,yyyy-MM-dd hh:mm"></td></tr>
                <tr><td>项目名称：</td><td><%pl.write("name");%></td></tr>
                <tr><td>项目类别：</td><td purchase="<%=pl.get("purchase_class")%>"></td></tr>
                <tr><td>产品类别：</td><td><%=pl.get("business_class")%></td></tr>
                <tr><td>联系人：</td><td><%pl.write("linkname");%></td></tr>
                <tr class="line"><td>联系电话：</td><td><%pl.write("phone");%></td></tr>
                <tr class="line">
                    <td>项目简介：</td>
                    <td><%pl.write("summary");%></td>
                </tr>
                <tr class="line">
                    <td>供应商资格：</td>
                    <td><%pl.write("conditions");%></td>
                </tr>
            </table>
            <div id="particulars">
                <h3>报价详情</h3>
                <ul id="table">
                    <li>
                        <span class="xh">序号</span>
                        <span class="wl">物料名称</span>
                        <span class="gg">规格型号</span>
                        <span class="sl">数量</span>
                        <span class="dw">单位</span>
                        <span class="dh">到货日期</span>
                        <span class="tp">图片</span>
                    </li>
                    <%
                        pml.select("materielname,model,amout,unit,attachurl,id,purchaseid,delivery_date").where("purchaseid=?", hrh.get("purchaseid")).get_page_asc("id");
                        int n = 1;
                        while (pml.for_in_rows()) {
                    %>
                    <li>
                        <span class="xh"><%=n%></span>
                        <span class="wl" choose='<%=pml.get("id")%>' chooses='<%=pml.get("purchaseid")%>'><%=pml.get("materielname")%></span>
                        <span class="gg"><%=pml.get("model")%></span>
                        <span class="sl"><%=pml.get("amout")%></span>
                        <span id="dw"><%=pml.get("unit")%></span>
                        <span class="dh" rssdate="<%=pml.get("delivery_date")%>,yyyy-MM-dd"></span>
                        <span class="tp"><img class="img" src="/upfile/<%=pml.get("attachurl")%>"></span>
                            <%
                                pmov.select().where("materielid=?", pml.get("id")).get_page_asc("materielid");
                                int i = 1;
                                while (pmov.for_in_rows()) {
                            %>
                        <table>
                            <tr>
                                <td class="textR">供应商：</td>
                                <td class="corpname" colspan="3" choose='<%=pmov.get("corpname")%>' chooses='<%=pmov.get("myid")%>'><%=pmov.get("corpname")%><input class="choose" type="radio" name="<%=pml.get("id")%>" value="<%=i%>"></td>
                            </tr>
                            <tr>
                                <td class="textR" rowspan="2">报价单：</td>
                                <td class="price" choose='<%=pmov.get("price")%>'>不含税单价：<%=pmov.get("price")%>元</td>
                                <td colspan="2"><span id="taxpoint">税点：<%=pmov.get("taxpoint")%></span>地址：<%=pmov.get("addr")%></td>
                            </tr>
                            <tr>
                                <td>报价有效期：<div rssdate="<%=pmov.get("enddt")%>,yyyy-MM-dd"></div></td>
                                <td class="freight" choose='<%=pmov.get("freight")%>'>总运费：<%=pmov.get("freight")%>元</td>
                                <td>产品图片：<img class="img" src="/upfile/<%=pmov.get("icourl")%>"/></td>
                            </tr>
                        </table>
                        <%
                                    i++;
                                }
                                n++;
                            }
                        %>
                    </li>
                </ul>
                <button marker="<%hrh.write("value");%>">定标</button>
            </div>
            <div id="result">
                <%
                    prlv.select().where("purchaseid=? and result=?", hrh.get("purchaseid"), "1").get_page_desc("id");
                %>
                <table>
                    <%
                        while (prlv.for_in_rows()) {
                    %>
                    <tr><td>项目结果：</td><td results="<%prlv.write("result");%>"></td></tr>
                    <tr><td>中标人：</td><td><%prlv.write("corpname");%><a href="my_project.jsp?purchaseid=<%prlv.write("id");%>&part=1&value=0">&nbsp;(点击查看项目详情)</a></td></tr>
                    <tr><td>联系电话：</td><td><%prlv.write("telphone");%></td></tr>
                    <%
                        }
                    %>
                </table>  
            </div>
            <div id="publish">
                <h3>报价详情</h3>
                <table>
                    <tr>
                        <td>物料名称</td>
                        <td>中标公司</td>
                        <td>不含税总价（元）</td>
                    </tr>
                </table>
                <button>发布</button>
            </div>
        </div>
        <%@include file="/inc/js_all.html" %>
        <script type="text/javascript" src="js/my_project.js"></script>
        <script type="text/javascript" src="/purchase/js/dictdata.js"></script>
    </body>
</html>
